<?php
/*
	本插件：$this->model('model')->方法名();
	其他地方调用：model('jy_kaoshi/model')->方法名();
*/
namespace jy_ailiao;
defined('BY_JYA') or exit('error');
class siimg extends \plugin{
	public function add_siimlog($tomid=0){
		$time=time()-1*3600;
		$isadd=pdo_get('jy_ailiao_siimglog',array('createtime >'=>$time,'uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['uid'],'tomid'=>$tomid));
		if($isadd['id']){
			return	false;
		}
		$insert=array(
			'uniacid'=>$_SESSION['uniacid'],
			'mid'=>$_SESSION['uid'],
			'tomid'=>$tomid,
			'createtime'=>TIMESTAMP,
		);
		pdo_insert('jy_ailiao_siimglog',$insert);
		return true;
	}
	public function add_sivideolog($tomid=0){
		$time=time()-1*3600;
		$isadd=pdo_get('jy_ailiao_sivideolog',array('createtime >'=>$time,'uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['uid'],'tomid'=>$tomid));
		if($isadd['id']){
			return	false;
		}
		$insert=array(
			'uniacid'=>$_SESSION['uniacid'],
			'mid'=>$_SESSION['uid'],
			'tomid'=>$tomid,
			'createtime'=>TIMESTAMP,
		);
		pdo_insert('jy_ailiao_sivideolog',$insert);
		return true;
	}
}
?>